package com.jvm.simulation.hotspot;

import java.util.concurrent.TimeUnit;

public class AllocatedObj {

    static int _1mb = 1024*1024;

    public static void main(String[] args) throws InterruptedException {
        byte[]
            allocation1,
            allocation2,
            allocation3,
            allocation4;

        for (int i = 0 ; ; i++){
            allocation1 = new byte[2 * _1mb];
            allocation2 = new byte[2 * _1mb];
            allocation3 = new byte[2 * _1mb];
            allocation4 = new byte[4 * _1mb];

            allocation1 = null;
            allocation2 = null;
            allocation3 = null;
            allocation4 = null;

            TimeUnit.SECONDS.sleep(3000);
            System.out.println(i);
        }

    }
}
